Skip to content

feat: Handle "synthesized" class/member annotations#52

Merged
loewenheim merged 10 commits intomasterfrom
sebastian/synthesized
Jul 14, 2025
Merged

feat: Handle "synthesized" class/member annotations#52
loewenheim merged 10 commits intomasterfrom
sebastian/synthesized

Conversation

@loewenheim
Copy link
Copy Markdown
Contributor

This adds support for "synthesized" class and member annotations.

  • It adds a new variant Synthesized to R8Header to parse these annotations.
  • It adds is_synthesized flags to ClassMapping and MemberMapping and their corresponding cache types. In the cache the flags have type u32 because bool would be unsound to transmute.
  • It adds an is_synthesized flag to StackFrame that is set if the frame's class or method are flagged as synthesized.
  • It adds cache-using variants to the tests in callback.rs.
  • It bumps the version of the proguard cache format to 2. The version needs to be increased because records now have an extra field.

With this change, remap_frame (both the mapper and the cache version) will return exactly the same frames as before, but some of them might be marked as synthesized. This means it's up to the caller to decide what to do with synthesized frames.

Closes #48. Closes RUSTPRO-3.

@loewenheim loewenheim requested a review from a team June 26, 2025 15:11
src/cache/raw.rs Outdated
/// Whether this class was synthesized by the compiler.
///
/// `0` means `false`, all other values mean `true`.
pub(crate) is_synthesized: u32,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe turn this into is_synthesized: u8, and add _reserved: [u8; 3] to the end.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's fair.

@loewenheim loewenheim force-pushed the sebastian/synthesized branch from 5bf88a5 to 6e7e9aa Compare July 7, 2025 09:55
@loewenheim loewenheim changed the base branch from master to sebastian/classes-methods-2 July 7, 2025 09:56
@loewenheim
Copy link
Copy Markdown
Contributor Author

This has been rewritten on top of #55.

Base automatically changed from sebastian/classes-methods-2 to master July 14, 2025 12:49
@loewenheim loewenheim force-pushed the sebastian/synthesized branch from 64e465c to 6e27ff4 Compare July 14, 2025 12:51
@loewenheim loewenheim merged commit 9e64ae5 into master Jul 14, 2025
7 checks passed
@loewenheim loewenheim deleted the sebastian/synthesized branch July 14, 2025 14:51
loewenheim added a commit to getsentry/symbolicator that referenced this pull request Jul 17, 2025
This updates the `proguard` dependency to 5.6.1 to get access to
"synthesized" flags in the cache format
(see getsentry/rust-proguard#52).

Since the cache format has changed, this requires an _incompatible_
bump of the proguard cache version.

It also adds a static version check for the cache version exposed by the
`proguard` crate in analogy to symcaches and cficaches.
loewenheim added a commit to getsentry/symbolicator that referenced this pull request Jul 17, 2025
This updates the `proguard` dependency to 5.6.1 to get access to
"synthesized" flags in the cache format
(see getsentry/rust-proguard#52).

Since the cache format has changed, this requires an _incompatible_
bump of the proguard cache version.

It also adds a static version check for the cache version exposed by the
`proguard` crate in analogy to symcaches and cficaches.
loewenheim added a commit to getsentry/symbolicator that referenced this pull request Jul 17, 2025
This updates the `proguard` dependency to 5.6.1 to get access to
"synthesized" flags in the cache format
(see getsentry/rust-proguard#52).

Since the cache format has changed, this requires an _incompatible_ bump
of the proguard cache version.

It also adds a static version check for the cache version exposed by the
`proguard` crate in analogy to symcaches and cficaches.

ref: #1720. ref: SYMBOLI-22.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support synthesized class annotations

4 participants